using System;
using System.Runtime.CompilerServices;
using jQueryApi;

namespace Yoshi.Fb
{
    // ReSharper disable UnassignedField.Global
    // ReSharper disable InconsistentNaming
    // ReSharper disable UnusedMember.Global
    // ReSharper disable NotAccessedField.Global

    [IgnoreNamespace]
    public sealed class FbUser
    {
        public string bio;
        public string birthday;
        public string email;
        public string first_name;
        public string gender;
        public string id;
        public string last_name;
        public string link;
        public string locale;
        public string name;
        public int timezone;
        public string updated_time;
        public bool verified;
        public FbWork[] work;

        private const string FbImgTpl = FbIdentity.FbUrlHttp + "/{0}/picture?type=large";

        public string PhotoUrl
        {
            get { return String.Format(FbImgTpl, id); }
        }

        public jQueryObject PhotoTag
        {
            get { return jQuery.FromHtml("<img/>").Attribute("src", PhotoUrl); }
        }


    }

    [IgnoreNamespace]
    public abstract class FbList
    {
        public string id;
        public string list_type;
        public string name;
    }

    [IgnoreNamespace]
    public abstract class FbResult
    {
        public object[] data;
        public FbObjectError error;
        public FbPaging paging;
    }

    [IgnoreNamespace]
    public abstract class FbPaging
    {
        public string next;
        public string prior;
    }

    [IgnoreNamespace]
    public sealed class FbLimitRequest
    {
        public string access_token;
        public int limit;
        public int offset;
    }

    [IgnoreNamespace]
    public abstract class FbOffsetRequest
    {
        public string access_token;
        public int limit;
        public int offset;
    }

    [IgnoreNamespace]
    public abstract class FbObject
    {
        public FbObjectError error;
    }

    [IgnoreNamespace]
    public abstract class FbObjectError
    {
        public string message;
        public string type;
    }

    [IgnoreNamespace]
    public sealed class FbAuth
    {
        public string access_token;
        public int expires; // 2 hrs later than last obtained access in ms
    }

    [IgnoreNamespace]
    public abstract class FbWork
    {
        public FbUser employer;
    }

    [IgnoreNamespace]
    public abstract class FbAlbum
    {
        public FbUser from;
        public string id;
        public string link;
        public string name;
        public string privacy;
        public string type;
    }

    [IgnoreNamespace]
    public abstract class FbPhoto
    {
        public FbComments comments;
        public string created_time;
        public FbUser from;
        public int height;
        public string icon;
        public string id;
        public FbImage[] images;
        public string link;
        public string name;
        public string picture;
        public int position;
        public string source;
        public FbTags tags;
        public string updated_time;
        public int width;
    }

    [IgnoreNamespace]
    public abstract class FbTags
    {
        public FbTag[] data;
    }

    [IgnoreNamespace]
    public abstract class FbTag
    {
        public string created_time;
        public string id;
        public string name;
        public int x;
        public int y;
    }

    [IgnoreNamespace]
    public abstract class FbNote
    {
        public string created_time;
        public FbUser from;
        public string icon;
        public string id;
        public string message;
        public string subject;
        public string updated_time;
    }

    [IgnoreNamespace]
    public abstract class FbImage
    {
        public int height;
        public string source;
        public int width;
    }

    [IgnoreNamespace]
    public abstract class FbComments
    {
        public FbComment[] data;
    }

    [IgnoreNamespace]
    public abstract class FbComment
    {
        public bool can_remove;
        public string created_time;
        public FbUser from;
        public string id;
        public string message;
    }

    [IgnoreNamespace]
    public sealed class FbSendStorage
    {
        public string access_token;
        public string id;
        public string jsonData;
        public string message;
        public string connection;
    }
}